﻿using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using YJTTool.Configure.Controls;
using YJTTool.Configure.ViewModels;
using YJTTool.Configure.Views;

namespace YJTTool.Configure
{
    public class ConfigureModule : IModule
    {
        private readonly IRegionManager _regionManager;

        public ConfigureModule(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }
        public void OnInitialized(IContainerProvider containerProvider)
        {
            _regionManager.RegisterViewWithRegion("ContentRegion", typeof(ScheduledRemindersView));
            _regionManager.RegisterViewWithRegion("ContentRegion", typeof(JsonConversionView));
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<ScheduledRemindersView>(typeof(ScheduledRemindersView).FullName);
            containerRegistry.RegisterForNavigation<JsonConversionView>(typeof(JsonConversionView).FullName);
            containerRegistry.RegisterDialog<CreateScheduledTaskDialogView, CreateScheduledTaskDialogViewModel>();
        }
    }
}